package com.scuec.tourismwebsite.service;

import com.scuec.tourismwebsite.entity.PostFavorite;
import com.scuec.tourismwebsite.mapper.PostFavoriteMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class PostFavoriteServiceImpl implements PostFavoriteService{
    @Autowired
    private PostFavoriteMapper postFavoriteMapper;


    @Override
    public int insertPostFavorite(int user_id, int post_id) {
        return postFavoriteMapper.insertPostFavorite(user_id, post_id);
    }

    @Override
    public int deletePostFavorite(int user_id, int post_id) {
        return postFavoriteMapper.deletePostFavorite(user_id, post_id);
    }

    @Override
    public List<PostFavorite> selectPostFavoriteById(int user_id, int post_id) {
        return postFavoriteMapper.selectPostFavoriteById(user_id, post_id);
    }

    @Override
    public List<PostFavorite> getUserFavorites(Integer user_id) {
        return postFavoriteMapper.getUserFavorites(user_id);
    }
}
